import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import { registerMicroApps, start } from 'qiankun'
import action from "base/action"
console.log("这是主应用", action)
registerMicroApps([
  {
    name: 'vue-app',
    entry: '//localhost:5555',
    container: '#childrenApp',
    activeRule: '/vue-app',
    props: {
        action
    }
  }
],{
    beforeLoad: [
        app => {
            console.log('before load', app.name)
        }
    ],
    beforeMount: [
        app => {
            console.log('before mount', app.name)
        }
    ],
    afterUnmount: [
        app => {
            console.log('after unmount', app.name)
        }
    ],
    afterMount: [
        app => {
            console.log('after mount', app.name)
        }
    ]
});
start({
    sandbox: {
        experimentalStyleIsolation: true // 启用样式隔离
    },
    singular: true
})

const pinia = createPinia();
const app = createApp(App);
app.use(router);
app.use(pinia);
app.mount('#app');
